<?php


namespace app\unify\validate;


use think\Validate;

class Role extends Validate
{
    const SAVE = "Save";
    const UPDATE = 'Update';

    const DELETE = 'Delete';

    protected $rule = [
        'name|名称' => 'require|length:0,50',
        'description|描述' => 'length:0,512',
        'authList|权限' => 'require|array',
        'id|角色' => 'require|integer',
        'ids|角色集合' => 'require|array',
    ];
    protected $scene = [
        self::SAVE => ['name', 'tag', 'description'],
        self::UPDATE => ['id', 'name', 'tag', 'description'],
        self::DELETE => ['ids'],
    ];

}